/*
 * Copyright (C) 2018 wxyz <hyhjwzx@126.com>
 * This program can be distributed under the terms of the GNU GPL Version 2.
 * See the file LICENSE.
 *
 */

package ren.wxyz.study.euler.hp01;

import ren.wxyz.study.euler.util.ConsoleHelper;
import ren.wxyz.study.euler.base.IProblem;

/**
 * 第一题
 *
 * @auther wxyz 2018-02-28_17:03
 * @since 1.0
 */
public class P001 implements IProblem {

    public void main(String[] args) throws Throwable {

        int maxNumber = Integer.parseInt(args[0]);
        int sum = 0;

        for (int i = 1; i < maxNumber; i++) {
            if (i % 3 == 0 || i % 5 == 0) {
                sum += i;
            }
        }

        ConsoleHelper.print("sum = " + sum);
    }
}
